package com.aliyun.messagemgt.application.service.Impl.push.sanheSms;

/**
 * 阿里短信推送渠道常量类
 *
 * @author byp
 * @date 2020/4/16
 * @see <a href="https://error-center.aliyun.com/status/product/Dysmsapi?spm=a2c4g.11186623.2.15.285156e03ElcNd"></a>
 */
public class DySmsConstant {

    /**
     * 短信推送结果
     */
    static final Integer DYSMS_PUSH_RESULT_SUCCESS = 1;
    static final Integer DYSMS_PUSH_RESULT_ERROR = 2;

    public static String transformApiCode(String code) {
        String message = "";
        switch (code) {
            case "isv.BLACK_KEY_CONTROL_LIMIT":
                message = "黑名单管控,建议联系平台解除黑名单";
                break;
            case "isv.MOBILE_NUMBER_ILLEGAL":
                message = "非法手机号,建议使用正确的手机号";
                break;
            case "VALVE:M_MC":
                message = "减少每分钟发送数量";
                break;
            case "VALVE:H_MC":
                message = "减少每小时发送数量";
                break;
            case "VALVE:D_MC":
                message = "减少每天发送数量";
                break;
            case "isv.ACCOUNT_ABNORMAL":
                message = "账户异常,建议联系平台确认账号";
                break;
            case "isv.AMOUNT_NOT_ENOUGH":
                message = "账户余额不足,建议进行账户充值";
                break;
            case "isv.ACCOUNT_NOT_EXISTS":
                message = "账户不存在,建议开通账户";
                break;
            case "isp.SYSTEM_ERROR":
                message = "系统错误,建议联系平台核查原因";
                break;
            case "isv.SMS_SIGNATURE_ILLEGAL":
                message = "短信签名不合法,建议重新申请签名";
                break;
            case "isv.SMS_TEMPLATE_ILLEGAL":
                message = "短信模板不合法,建议重新申请模版";
                break;
            case "isv.TEMPLATE_MISSING_PARAMETERS":
                message = "模板缺少变量,建议修改模版";
                break;
            case "isv.TEMPLATE_PARAMS_ILLEGAL":
                message = "模板变量里包含非法关键字,建议修改模版";
                break;
            case "isv.PRODUCT_UN_SUBSCRIPT":
                message = "未开通云通信产品的阿里云客户";
                break;
            case "isv.MOBILE_COUNT_OVER_LIMIT":
                message = "手机号码数量超过限制,建议减少手机号码";
                break;
            case "isv.PARAM_LENGTH_LIMIT":
                message = "参数超出长度限制";
                break;
            case "isv.INVALID_PARAMETERS":
                message = "建议使用正确的参数";
                break;
            case "FILTER":
                message = "关键字拦截,建议修改短信内容";
                break;
            case "isv.PRODUCT_UNSUBSCRIBE":
                message = "产品未开通,建议订购产品";
                break;
            case "isv.BUSINESS_LIMIT_CONTROL":
                message = "业务限流,建议联系平台核查原因";
                break;
            case "isv.OUT_OF_SERVICE":
                message = "业务停机,建议联系平台核查原因";
                break;
            case "isv.PARAM_NOT_SUPPORT_URL":
                message = "不支持URL,建议删除内容中的URL";
                break;
            case "MissingParameter.To":
                message = "确少To参数";
                break;
            case "MissingParameter.Message":
                message = "参数Message缺失";
                break;
            case "Forbidden.Operation":
                message = "无权限进行此操作";
                break;
            case "Account.Abnormal":
                message = "账号状态不正确";
                break;
            case "InvalidParameter.Type":
                message = "参数Type无效，请检查参数值";
                break;
            case "InvalidParameter.To":
                message = "参数To无效，请检查参数值";
                break;
            case "InvalidParameter.SenderId":
                message = "参数SenderId无效，请检查参数值";
                break;
            case "PhoneNumber.Illegal":
                message = "手机号码无效或者错误";
                break;
            case "InvalidParameter.From":
                message = "参数From无效，请检查参数值";
                break;
            case "InvalidParameter.ExternalId":
                message = "参数ExternalId无效，请检查参数值";
                break;
            case "Unsupport.CountryCode":
                message = "不支持的国家码";
                break;
            case "Unknown.CountryCode":
                message = "不能识别国家码";
                break;
            case "InvalidParameter.Channel":
                message = "参数Channel无效";
                break;
            case "MonthLimitControl":
                message = "发送量超过月限额";
                break;
            case "DayLimitControl":
                message = "发送量超过日限额";
                break;
            case "OutOfService":
                message = "账号已停机";
                break;
            case "Amount.NotEnough":
                message = "余额不足";
                break;
            case "isp.RAM_PERMISSION_DENY":
                message = "建议联系平台核查原因";
                break;
            case "isv.INVALID_JSON_PARAM":
                message = "建议修改JSON参数";
                break;
            default:
                break;
        }

        return message;
    }

}
